﻿using Microsoft.Practices.Unity;
using Blogger.UI.Data;
using Unity.Mvc4;
using System.Web.Mvc;
using System.Web.Http;
using System.Web.Http.Dependencies;
using System.Collections.Generic;
using System;
using POC.Azure.Storage;
using Blogger.UI.Controllers;
using Blogger.UI;

namespace POC.IOC
{
    class IoCContainer : ScopeContainer, System.Web.Mvc.IDependencyResolver
    {
        public IoCContainer(IUnityContainer container)
            : base(container)
        {
        }

        public IDependencyScope BeginScope()
        {
            var child = container.CreateChildContainer();
            return new ScopeContainer(child);
        }
    }
}